package com.study.spwar.web;

import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;

import javax.annotation.Resource;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;


/**
 * @Title: BaseController.java
 * @Package cn.zhuzi.sys.control
 * @Description: TODO(基本controller)
 * @author 作者 grq
 * @version 创建时间：2018年8月4日 下午1:33:10
 *
 */

public class SysBaseController {
	@Resource
	protected HttpServletRequest req;
	@Resource
	protected HttpServletResponse resp;

	@Resource
	protected ServletContext servletContext;
  

	/**
	 * 使用此方法，普通方法可以得到request对象
	 */
	protected HttpServletRequest getRequest() {
		return ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
	}

}
